package com.dailyblue.project.estate.controller;

import com.dailyblue.project.estate.commons.bean.ParkingUse;
import com.dailyblue.project.estate.commons.util.JsonResult;
import com.dailyblue.project.estate.service.ParkingUseService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther:Liu
 * @Testname:ParkingUseController
 * @Date:2025/9/18 15:55
 */
@RestController
@RequestMapping("/parkingUse")
public class ParkingUseController {
    @Resource
    private ParkingUseService parkingUseService;
    @PostMapping
    JsonResult saveParkingUse(ParkingUse parkingUse) {
        return parkingUseService.saveParkingUse(parkingUse);
    }
    @GetMapping("/findOne/{id}")
    JsonResult findOneParkingUse(@PathVariable("id") String parkingUseId) {
        return parkingUseService.findOneParkingUse(parkingUseId);
    }
    @GetMapping
    JsonResult findAllParkingUse() {
        return parkingUseService.findAllParkingUse();

    }
    @DeleteMapping("/delete/{id}")
    JsonResult deleteParkingUse(@PathVariable("id") String parkingUseId) {
        return parkingUseService.deleteParkingUse(parkingUseId);
    }
    @PutMapping("/update")
    JsonResult updateParkingUse(@RequestBody ParkingUse parkingUse) {
        return parkingUseService.updateParkingUse(parkingUse);
    }
}
